<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<c:set var="jpath" value="${pageContext.request.contextPath }"/>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="${jpath}/static/qd/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="${jpath}/static/qd/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="${jpath}/static/qd/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="${jpath}/static/qd/css/login.css"/>

<title>Login</title>
</head>
<body>
	<div id="all">
		<div id="nav_bk">
			<div id="nav">
				<div class="orange_text big_size_text">双流互联网+政银企业</div>
				<div class="orange_text big_size_text" id="title_text">自动对接融资服务综合平台</div>
				<div class="white_text" id="title_text">The Internet + government and silver enterprises' automatic </div>
				<div class="white_text" id="title_text">docking financing service integrated platform </div>
			</div>
			<div id="login_regest">
				<div class="container">
					<div class="row">
						<div id="reg_btn" class="col-xs-6 white_text login_regest_text">注册</div>
						<div id="login_btn" class="col-xs-6 white_text login_regest_text_icon">登录</div>
					</div>
				</div>
			</div>
		</div>
		<div id="content">
			<form id="loginForm" method="post">
				<div class="container" id="login_box" style="display:block;">
					<div class="row">
						<div class="col-xs-12"><input type="text" id="loginAccount" name="loginAccount" class="input email"  placeholder="邮箱/用户名"/></div>
						<div class="col-xs-12"><input type="password" id="loginPwd" name="loginPwd" class="input pwd" placeholder="密码"/></div>
					</div>
					<div id="login_submit">
						<input type="button" id="loginBtn" class="login_input" value="登录"/>
					</div>
					<div id="tel_login_submit">
						<input type="button" class="tel_login_input" value="手机号登录"/>
					</div>
					<div id="forget_pwd">
						忘记密码？<a>请点击</a>
					</div>
				</div>
				<div class="container" id="reg_box" style="display:none;">
					<div class="row">
						<div class="col-xs-12"><input type="text" class="input email"  placeholder="邮箱号码"/></div>
						<div class="col-xs-12"><input type="text" class="input user" placeholder="用户名"/></div>
						<div class="col-xs-12"><input type="text" class="input pwd" placeholder="密码"/></div>
					</div>
					<div id="login_submit">
						<input type="button" id="regBtn" class="login_input" value="注册"/>
					</div>
					<div id="forget_pwd">
						已经注册了吗？<a>请登录</a>
					</div>
					<input id="xuanxiang" type="hidden" value="${xuanxiang}"/>
				</div>
			</form>
		</div>
	</div>
<%@include file="js.jsp"%>
<script src="${jpath}/js/system_plugins.js"></script>
<script type="text/javascript" >
	 $(function() {
		if($("#xuanxiang").val()!=0){
	        $("#reg_btn").css('background-image','url(img/icon.png)'); 
	        $("#login_btn").css('background-image','url()'); 
			$("#login_box").css('display','none');
			$("#reg_box").css('display','block');
	 	}
		$("#login_btn").click(function() {	
	        $("#reg_btn").css('background-image','url()'); 
	        $("#login_btn").css('background-image','url(img/icon.png)'); 
			$("#login_box").css('display','block');
			$("#reg_box").css('display','none');
	       });
		$("#reg_btn").click(function() {
		 	if($("#xuanxiang").val()==0){
		        $("#reg_btn").css('background-image','url(img/icon.png)'); 
		        $("#login_btn").css('background-image','url()'); 
				$("#login_box").css('display','none');
				$("#reg_box").css('display','block');
				location.href="${jpath}/qd/renwuxuanze";
		 	}
	    });
       $("#loginBtn").click(function() {
		var jsonForms=getForm("#loginForm");
		if($("#loginAccount").val()=="" || $("#loginPwd").val()==""){
			console.log("请输入完整的登录信息");
			return false;
		}
		$.post("${jpath}/login",jsonForms,function(data){
				var json=$.parseJSON(data);
				console.log(json.resMsg);
				location.href="${jpath}/qd/index";
			}
		);
       });
		$("#regBtn").click(function() {
				location.href="${jpath}/qd/login";
	       });
	 });
</script>
</body>
</html>
